package blog.spring.db.entity;

// Generated 2015-1-30 0:04:13 by Hibernate Tools 4.0.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * CmsUser generated by hbm2java
 */
@Entity
@Table(name = "cms_user", catalog = "blog")
public class CmsUser implements java.io.Serializable {

	private int userId;
	@JsonIgnore
	private User user;
	private int relation;
	private int source;
	private int attentionDegree;

	public CmsUser() {
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "user"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "user_id", unique = true, nullable = false)
	public int getUserId() {
		return this.userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "relation", nullable = false)
	public int getRelation() {
		return this.relation;
	}

	public void setRelation(int relation) {
		this.relation = relation;
	}

	@Column(name = "source", nullable = false)
	public int getSource() {
		return this.source;
	}

	public void setSource(int source) {
		this.source = source;
	}

	@Column(name = "attention_degree", nullable = false)
	public int getAttentionDegree() {
		return this.attentionDegree;
	}

	public void setAttentionDegree(int attentionDegree) {
		this.attentionDegree = attentionDegree;
	}

}
